gtkplacessidebar: Improve error message when unlocking volume fails
authorsegfault <segfault@riseup.net>
Mon, 23 Jul 2018 21:35:01 +0000 (23:35 +0200)
committersegfault <segfault@riseup.net>
Mon, 23 Jul 2018 21:38:06 +0000 (23:38 +0200)
gtk/gtkplacessidebar.c

index 17fee6d5f57b33d3b37e15758dde72292f205859..31b968d0f401cd5adf334bd145d9880541e3a8ee 100644 (file)
@@ -2416,7 +2416,10 @@ volume_mount_cb (GObject      *source_object,
           error->code != G_IO_ERROR_ALREADY_MOUNTED)
         {
           name = g_volume_get_name (G_VOLUME (source_object));
-          primary = g_strdup_printf (_("Unable to access “%s”"), name);
+          if (g_str_has_prefix (error->message, "Error unlocking"))
+            primary = g_strdup_printf (_("Error unlocking “%s”"), name);
+          else
+            primary = g_strdup_printf (_("Unable to access “%s”"), name);
           g_free (name);
           emit_show_error_message (sidebar, primary, error->message);
           g_free (primary);